Piano VB MIDI Piano wwwwwwwwwwwwwwp Form15G Panel3D3 SSPanel PianoKey SSPanel PianoKey SSPanel PianoKey SSPanel PianoKey SSPanel PianoKey SSPanel PianoKey SSPanel PianoKey SSPanel PianoKey SSPanel PianoKey SSPanel PianoKey SSPanel PianoKey SSPanel PianoKey SSPanel PianoKey SSPanel PianoKey SSPanel PianoKey SSPanel PianoKey SSPanel PianoKey SSPanel PianoKey SSPanel PianoKey SSPanel PianoKey SSPanel PianoKey SSPanel PianoKey SSPanel PianoKey SSPanel PianoKey SSPanel PianoKey SSPanel PianoKey SSPanel PianoKey SSPanel PianoKey SSPanel PianoKey SSPanel PianoKey SSPanel PianoKey SSPanel PianoKey SSPanel PianoKey SSPanel PianoKey SSPanel PianoKey SSPanel PianoKey SSPanel PianoKey SSPanel PianoKey SSPanel PianoKey SSPanel PianoKey SSPanel PianoKey SSPanel PianoKey SSPanel PianoKey SSPanel PianoKey SSPanel PianoKey SSPanel PianoKey SSPanel PianoKey SSPanel PianoKey SSPanel PianoKey SSPanel PianoKey SSPanel PianoKey SSPanel PianoKey SSPanel PianoKey SSPanel PianoKey SSPanel PianoKey SSPanel PianoKey SSPanel PianoKey SSPanel PianoKey SSPanel PianoKey SSPanel PianoKey SSPanel PianoKey SSPanel PianoKey SSPanel PianoKey SSPanel PianoKey SSPanel PianoKey SSPanel FramePianoSettings Piano MIDI Settings MS Sans Serif FrameOctave Octave MS Sans Serif HScrollOctave FramePan L - Pan - R MS Sans Serif HScrollPan FrameMidiChannelOut MIDI Channel MS Sans Serif HScrollMIDIChannel FramePatch Patch MS Sans Serif ComboPatch General MIDI Patches MS Sans Serif FrameVolume Volume MS Sans Serif HScrollVolume mnuFile &File mnuFileExit E&xit mnuHelp &Help mnuHelpAbout &About BlackKey_MouseDown Index Button Shifth NoteValid; KeySignatureOffSet. ModeOffSetx PianoScale Keyboard BlackKey BackColor^ ColorBlackKeyDown MidiEventOut1 midiChannelOutO MidiVelOut MidiVelocitya MidiNoteOut SendMidiOutq Mdevicen Menu_HelpSelect' Checked sndPlaySound NkeyPathD BlackKey_MouseUpQ BLACK @ Form_Load WhiteKey_MouseDown WhiteKey ColorWhiteKeyDown WhiteKey_MouseUp' WHITE BlackKey_DragDrop Source Control BlackKey_DragOver State* WhiteKey_DragDropc WhiteKey_DragOver Form_MouseDown KeyPressedDown KeyCode KeyPress Form_KeyUp3 KeyReleasedUpI KeyRelease Form_KeyDown@ MousePKeyCount MouseKeyCount NoteMOD MousePointer MouseKeyDown MouseDown MouseCount Mouse' MousR eCount noteOnCatcher; noteCatchCountr NoteOnCatch WhiteKeyWhiteKey Label1~ CaptionF MidiOutOpen hMidiOut HScroll1_Change Hscroll1" Value MidiChannelOutLabel4 Hscroll2p midiPatch Hscroll3 midiVolume PanLabel midiPan( HScroll2_Change ReadPatch^ MidiPortKeyboardJ MidiPortSongPlayer TrackChannel ReadPatchMixer HScroll3_Change VolumeLabel MidiMixer VScroll1 Spin2_SpinDownc LabelPan_ MidiChannelOutLabel_DragDrop` Spin2_SpinUp Pianor Form_Unload Cancel MidiOutClose hmidioutcopy6 MidiOutOpenPortK FindPianoPathx HScroll4_Change Hscroll4 SSFrame4_DragDrop Command3D1_Click WhiteKey1_Click9 WhiteKey1_DragOver WhiteKey1_DragDrop Image1_Click WhiteKey1_MouseDown WhiteKey1 Picture Imagej Image2 WhiteKey1_MouseUp Image1 BlackKey1_Click Picture1_Click PianoKey_DragDrop PianoKey_DragOver PianoKey Exit_Click HScrollOctave_Change LabelOctave HScrollOctave octave HScrolOctave Screen About_Click About{ AboutBox1^ Modal5 PanelWhite_DragDropV PanelWhite PanelBlackL PanelBlack_DragDrop PatchLabel_DragDropz PanelWhite_DragOver PanelBlack_DragOver PanelWhite_Click PanelWhite_DblClick BevelOuter File_Click SSPanel9_DragDrop_ HScrollMIDIChannel @ HScrollMIDIChannel_Change8 @ HScrollVolume_ChangeI HScrollVolumep HScrollPatch_Change HScrollPatch HScrollPan_Change* HScrollPanz FrameMidiChannelOut Explicted FrameVolume FrameOctave ComboPatche ListIndexD Command1_Click Frame1_DragDrop ComboPatch_Change MIDIOutput17 Message PROGRAM_CHANGE Data1 Data2- ActionU MIDIOUT_SEND CONTROLLER_CHANGEk midiMessageOutJ NOTE_ONu ComboPatch_Click mnuExit_Click mnuHelpAbout_Click mnuFileExit_Click midiData1 midiData2? played example program check should available wherever simple advanced mnuFile_Click If you're not quite ready for this "VB MIDI Piano" example, a less advanced MIDI example program is available. Check out my "One Note MIDI" e example. It should be available wherever "VB MIDI Piano" was located.I It's simple...it's FREE!! If you really want to do more neat stuff with MIDI and VB, youe should check out MIDI CoolTools.a I've been developing MIDI applications in Visual Basic since VB 1.0 and Windows 3.0. After years of limitations and more limitations withI VB and MIDI, it seemed like a good idea to take my experience and really make it possible to write MIDI apps in VB. ...after months of working with two VB custom control experts, wed have MIDI CoolTools...i MIDI CoolTools is a set of MIDI custom controls for Visual Basic. MIDI CoolTools gives you full access to MIDI from inside of Visual Basic.I The following controls make up MIDI CoolTools:n MIDI IN Custom Control: The MIDI IN Custom Control automatically detects the available MIDI IN ports and allows you to select the port you wish to use. As MIDI events are received through the selected MIDI IN port, eacho MIDI event receives a high resolution time stamp. A built in message queue allows Long and Short MIDI messages to be received. * Receive MIDI messages from external MIDI devices * Messages can be retrieved using events or polling * Messages are time-stamped with millisecond accuracy * Built in internal queuing mechanismi * Buffer for receiving system exclusive messages * Automatically detects the available MIDI IN portsc MIDI OUT Custom Control: The MIDI OUT Custom Control automatically detects the available MIDI OUT ports and allows you to select a MIDI OUT port tot use. This control allows MIDI messages to be sent directly to the MIDI OUT port and also allows MIDI messages to be queued for playback at the appropriate time. * Complete control over the contents and timing of MIDI messages.t * Queue as many messages as you like (within the constraints of available memory) * Queue messages prior to starting output and then add more as the output proceedse * Messages are scheduled for transmission at a time you specifyt * Control timing has millisecond resolutiont * Automatically detects the available MIDI OUT ports * Complete support for system exclusive messages * Timer event provides a high-resolution timer * Automatically detect whether or not the current device supports patchu caching * Automatically detect and control current device volume * Adjust tempo playback rate in realtime Standard MIDI File Custom Control: Read and write Standard MIDI files.c This custom control allows you to read any Standard MIDI file into a data structure with full access to the MIDI data. Open MIDI files, close MIDI files, create new MIDI files, save changes, insert new MIDI message, modify MIDI messages and delete MIDI message. Supports MIDI file type 0 & 1. * Provides the VB programmer with an easy way to read and write Standard MIDI filest * Both formats 0 (single track) and 1 (multiple-tracks) are supporteda * Modify existing MIDI files or create entirely new ones from scratcha * Complete control over and access to every type of MIDI message * Insert, delete and modify tracks and messages at anytime * Action property to open, close, create and save the data to the current filei * Action property to insert, change and delete the current message * Insert new tracks or delete tracks * Complete support for system exclusive messages Knob Custom Control: Four different knob styles to choose from makes then knob custom control very versatile. A collection of flexible tickmarkh properties greatly enhances the knob's usefulness for developingc commercial applications. Easily control knob color with five differenth color properties. Over thirty knob properties are at your control tips! * Normal, raised, lowered and textured knob styles * User definable number of tickmarks with captions * Full control of tick caption fonts * Control knob color, tick color, tick caption color and backgroundi color * Bevel properties for 3D style look * Link to other MIDI CoolTools custom control without writing any code VU Indicator Custom Control: Horizontal and vertical Indicator custom controls allow you to quickly create professional VU segmented meters. This custom control was specially designed to allow you to simply create state-of-the-art graphic LED VU meters. Three separate colored segment sections can be defined with up to twenty LED segments per section. At comprehensive set of 3D bevel properties allows for flexible visual control.n * Horizontal and vertical indicator (otherwise known as a VU meter). * Tie directly to other controls in this package using SmartLink propertiest * Display information (such as volume, balance, etc.)g * A comprehensive set of 3D bevel properties allows for flexible visual control.e * Three separate colored segment sections can be defined Fader/Slider Custom Control: Easily create a cool looking audio mixer with the Fader/Slider horizontal and vertical custom controls. A complete set of bevel properties allows you to quickly get that beautiful 3D look. Four different thumb styles adds to the flexibility of this control.. Tickmark properties round out this control's great features.c * Complete set of bevel properties * Slider control is similar in function to a scroll bar, but looks coolerr * Pro audio mixer style thumbs * Up, down, left and right thumb propertiesa * Tick properties with tickcolor, tickcount, tickwidth, ticklength & gap control * Horizontal and vertical slider custom controls * Control of the 3-D style of the track MIDI CoolTools includes all of these custom controls. Also included& is sample code and a printed reference manual. Standard Retail Price is $99 for MIDI CoolTools, but through December 31, 1994 we're& offering MIDI CoolTools for $59 + $4 s/h. $8 s/h for foreign orders. You can order with VISA/MC or Check in US funds:h MIDI CoolToolsw Artic Softwarew PO Box 28 Waterford, WI 53185-0028 Fax orders: 414-534-78098 Voice : 414-534-43097 Compuserve 75410,2203 Thanks for trying out my VB MIDI Piano Example. If this example was useful or if you have other VB MIDI questions just let me know... - Arthur Edstrom, Artic Softwareo ComboPatch_Click Sets the Patch for the current Midi Channel Out Patch Midi Out routine Form_Load Place the Piano form at the upper left corner of the screena General MIDI patches You could put this these patches into a PATCH.INI file to allow for the selection of other patches than General MIDIl Acoustic Grand Piano Bright Acoustic Piano Electric Grand Piano Honkytonk Piano Rhodes Piano Chorus Piano Harpsichord Clavinet Celesta Glockenspiel Music Box Vibraphone Marimba Xylophone Tubular Bells Dulcimer Hammond Organ Percuss. Organ Rock Organ Church Organ Reed Organ Accordion Harmonica Tango Accordion Acoustic Guitar (nylon) Acoustic Guitar (steel) Electric Guitar (jazz) Electric Guitar (clean) Electric Guitar (muted) Overdriven Guitar Distortion Guitar Guitar Harmonics Acoustic Bass Electric Bass (finger) Electric Bass (pick) Fretless Bass Slap Bass 1 Slap Bass 2 Synth Bass 1 Synth Bass 2 Violin Viola Cello Contra Bass Tremolo Strings Pizzicato Strings Orchestral Harp Timpani String Ensemble 1 String Ensemble 2 Synth Strings 1 Synth Strings 2 Choir Aahs Voice Oohs Synth Voice Orchestra Hit Trumpet Trombone Muted Trumpet French Horn Brass Section Synth Brass 1 Synth Brass 2 Soprano Sax Alto Sax Tenor Sax Baritone Sax English Horn Bassoon Clarinet Piccolo Flute Recorder Pan Flute Bottle Blow Shaku Whistle Ocarina Lead 1 (square) Lead 2 (saw tooth) Lead 3 (calliope lead) Lead 4 (chiff lead) Lead 5 (charang) Lead 6 (voice) Lead 7 (fifths) Lead 8 (bass + lead) Pad 1 (new age) Pad 2 (warm) Pad 3 (poly synth) Pad 4 (choir) Pad 5 (bowed) Pad 6 (metallic) Pad 7 (halo) Pad 8 (sweep) FX 1 (rain) FX 2 (sound track) FX 3 (crystal) FX 4 (atmo - sphere) FX 5 (bright) FX 6 (goblins) FX 7 (echoes) FX 8 (sci-fi) Sitar Banjo Shamisen Kalimba Bagpipe Fiddle Shanai Tinkle Bell Agogo Steel Drums Wood block Taiko Drum Melodic Tom Synth Drum Reverse Cymbal Guitar Fret Noise Breath Noise Seashore Bird Tweet Telephone Ring Helicopter Applause Gunshot Open Midi Driver Form_Unload Close the MIDIOut port HScrollMIDIChannel_Change Change Midi Channel to Vscroll1 value Display new channel MIDI Channel Sets the Patch & Volume for the current Midi Channel Outn HScrollOctave_Change Octave HScrollPan_Change Pan Midi Out routine HScrollVolume_Change Volume mnuFileExit_Click Close the MIDIOut Port mnuHelpAbout_Click PianoKey_DragDrop PianoKey_DragOver If still on same note, discard Since drag/drop is being used, we must keep track of the note being played.y Don't let array get out of range